package com.efast.cafe.portal.dao.common;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import com.efast.cafe.portal.entity.common.PortalCommonLaud;

public interface PortalCommonLaudDao {

	/**
	 * 删除留言下的所有的点赞
	 * @param objectId 这里是留言的id
	 * @param objectType 这里是留言的类型
	 * @param companyCode
	 */
	public void deleteLeaveLaud(@Param(value="objectId")Integer objectId,@Param(value="objectType")String objectType,@Param(value="companyCode")String companyCode);

	/**
	 * 添加點贊
	 * @param laud
	 */
	public void addLaud(PortalCommonLaud laud);

	/**
	 * 删除当前用户对某一个对象的点赞
	 * @param objectId 业务对象id
	 * @param objectType 业务对象类型
	 * @param companyCode 企业代码
	 * @param currentUser 当前用户
	 */
	public void deleteMyLaud(@Param(value="objectId")Integer objectId,@Param(value="objectType")String objectType,@Param(value="companyCode")String companyCode,@Param(value="currentUser")String currentUser);

	/**
	 * 统计某个业务对象的点赞数
	 * @param objectId
	 * @param objectType
	 * @param companyCode
	 * @return
	 */
	public Integer queryLaud(@Param(value="objectId")Integer objectId,@Param(value="objectType")String objectType,@Param(value="companyCode")String companyCode);

	/**
	 * 统计某个业务对象的当前用户是否有点赞
	 * @param objectId
	 * @param objectType
	 * @param companyCode
	 * @return
	 */
	public Integer queryCurrentUserLaud(@Param(value="objectId")Integer objectId,@Param(value="objectType")String objectType,@Param(value="companyCode")String companyCode,@Param(value="currentUser")String currentUser);

}
